package it.rockliveitalia;

import org.acra.ACRA;

import org.acra.ACRAConfiguration;
import org.acra.ReportField;
import org.acra.ReportingInteractionMode;
import org.acra.annotation.ReportsCrashes;

import android.app.Application;


@ReportsCrashes(
        formKey = "",
        formUri = "http://rockliveitalia.cloudant.com/acra-rockliveitalia/_design/acra-storage/_update/report",
        reportType = org.acra.sender.HttpSender.Type.JSON,
        httpMethod = org.acra.sender.HttpSender.Method.PUT,
        formUriBasicAuthLogin="laidestlysedellynimsibla",
        formUriBasicAuthPassword="J61JCVSdGLDetMciFhMKB13e",
        mode = ReportingInteractionMode.DIALOG,
        resToastText = R.string.crash_toast_text, // optional, displayed as soon as the crash occurs, before collecting data which can take a few seconds
        resDialogText = R.string.crash_dialog_text,
        resDialogIcon = android.R.drawable.ic_dialog_info, //optional. default is a warning sign
        resDialogTitle = R.string.crash_dialog_title, // optional. default is your application name
        resDialogCommentPrompt = R.string.crash_dialog_comment_prompt, // optional. when defined, adds a user text field input with this text resource as a label
        resDialogOkToast = R.string.txt_thanks, // optional. displays a Toast message when the user accepts to send a report.
        resDialogEmailPrompt = R.string.crash_dialog_email
        )
public class RockLiveItaliaApplication extends Application {
	
	private static ACRAConfiguration ACRAFeedbackConfig;
	private static ACRAConfiguration ACRAStandardConfig;
	
	@Override
	public void onCreate(){
		super.onCreate();
		ACRA.init(this);
		ACRAFeedbackConfig = ACRA.getNewDefaultConfig(this);
		ACRAFeedbackConfig.setCustomReportContent(new ReportField[] {
													  ReportField.ANDROID_VERSION,
													  ReportField.APP_VERSION_CODE,
													  ReportField.APP_VERSION_NAME,
													  ReportField.BRAND,
													  ReportField.BUILD,
													  ReportField.CUSTOM_DATA,
													  ReportField.DEVICE_ID,
													  ReportField.INSTALLATION_ID,
													  ReportField.IS_SILENT,
													  ReportField.PACKAGE_NAME,
													  ReportField.PHONE_MODEL,
													  ReportField.PRODUCT,
													  ReportField.RADIOLOG,
													  ReportField.REPORT_ID,
													  ReportField.USER_APP_START_DATE,
													  ReportField.USER_COMMENT,
													  ReportField.USER_CRASH_DATE,
													  ReportField.DISPLAY, 
													  ReportField.ENVIRONMENT, 
													  ReportField.FILE_PATH,
													  } );
		ACRAStandardConfig = ACRA.getConfig();
	}
	
	public static ACRAConfiguration getACRAFeedbackConfig() {return ACRAFeedbackConfig;}
	public static ACRAConfiguration getACRAStandardConfig() {return ACRAStandardConfig;}

}
